package sg.edu.ntu.sci.blackboard.agilix.model;

import java.io.IOException;
import sg.edu.ntu.sci.blackboard.agilix.AgilixSettings;
import sg.edu.ntu.sci.blackboard.agilix.util.IOUtil;

/**
 *
 * @author ngocgiang
 */
public class CourseElement {

    public String getFile() {
        return file;
    }

    public void setFile(String file) {
        this.file = file;
    }

    public String getFolder() {
        return folder;
    }

    public void setFolder(String folder) {
        this.folder = folder;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitlecolor() {
        return titlecolor;
    }

    public void setTitlecolor(String titlecolor) {
        this.titlecolor = titlecolor;
    }

    public static String readFile(CourseElement element) throws IOException {
        String messageFile = AgilixSettings.getHome() + "\\" + element.getFolder() + "\\" + element.getFile();
        return IOUtil.readFile(messageFile);
    }

    private String id;
    private String title;
    private String file;
    private String folder;
    private String titlecolor;
}
